using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class T_AcctGroupMap : EntityTypeConfiguration<T_AcctGroup>
    {
        public T_AcctGroupMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FClassID, t.FGroupID });

            // Properties
            this.Property(t => t.FClassID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FGroupID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(26);

            this.Property(t => t.FName_Cht)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FName_EN)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.Fmodifytime)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            // Table & Column Mappings
            this.ToTable("T_AcctGroup");
            this.Property(t => t.FClassID).HasColumnName("FClassID");
            this.Property(t => t.FGroupID).HasColumnName("FGroupID");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FName_Cht).HasColumnName("FName_Cht");
            this.Property(t => t.FName_EN).HasColumnName("FName_EN");
            this.Property(t => t.Fmodifytime).HasColumnName("Fmodifytime");
            this.Property(t => t.UUID).HasColumnName("UUID");
        }
    }
}
